
import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
import App from './App'

import router from './router'   // 扫描router下的路由

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'



// use
Vue.use(mavonEditor)

Vue.use(router);
Vue.use(ElementUI);
Vue.use(VueAxios, axios)
Vue.use(require('vue-moment'));



axios.interceptors.request.use(config => {    //配置axios请求头，axios每次发起请求携带token，在Network中的headers看的到
	// console.log(config)
	config.headers.Authorization = window.sessionStorage.getItem('token')  //Authorization  是请求头要求加上的字段
	return config
})

window.router=router;
new Vue({
	el: '#app',
	router,
	data: function(){
        return {
            // detailBlog: [],
        }
    },
	render: h => h(App)
});
